package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.common.entity.QueryPageBean;
import com.itheima.pojo.CheckItem;
import com.itheima.pojo.po.CheckitemPo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CheckitemMapper {

    @Insert("insert into t_checkitem (code, name, sex, age, price, type, attention, remark) VALUES (#{code},#{name},#{sex},#{age},#{price},#{type},#{attention},#{remark}) ")
    void addCheck(CheckitemPo checkitem);

    void edit(CheckitemPo checkitem);

    Page<CheckItem> pageQueryCheck(QueryPageBean queryPageBean);

    @Delete("delete from t_checkitem where id=#{id}")
    void deleteById(Integer id);

    @Select("select * from t_checkitem")
    List<CheckItem> findAllCheck();

    @Select("select * from t_checkitem where id=#{id}")
    CheckItem findById(Integer id);

    List<Integer> getByGroupListId(List<Integer> checkgroupItemList);
}
